package Collection;

import java.util.Arrays;
import java.util.List;

public class ArrayTList {
    public static void main(String[] args) {
        String[] array={"中国","美国","日本","法国","英国"};
        System.out.println(Arrays.toString(array));
        List<String> list =Arrays.asList(array);
        System.out.println(list);
        array[0]="中国是世界第一大国";
        System.out.println("数组"+Arrays.toString(array));
        System.out.println("集合"+list);
        list.set(1,"美国即将灭国");
        System.out.println("数组"+Arrays.toString(array));
        System.out.println("集合"+list);
//        list.add("此处会报错");//给集合加元素相当于给数组加元素，会报操作不支持异常

    }
}
